
#include <BConearConstraint>
#include "member_BConearConstraint.h"

using namespace BWE;

#define member						(*(member_BConearConstraint*)_ptr)
#define member_allocate()			_ptr = new member_BConearConstraint(this)
#define member_release()			delete (member_BConearConstraint*)_ptr

BConearConstraint::BConearConstraint()
{
	member_allocate();
}
BConearConstraint::BConearConstraint(BNode* nodeA, const BVector& pointA, const BVector& axisA) : BConstraint(nodeA, pointA, axisA)
{
	member_allocate();
}
BConearConstraint::BConearConstraint(BNode* nodeA, BNode* nodeB) : BConstraint(nodeA, nodeB)
{
	member_allocate();
}
BConearConstraint::BConearConstraint(BNode* nodeA, const BVector& pointA, BNode* nodeB, const BVector& pointB) : BConstraint(nodeA, pointA, nodeB, pointB)
{
	member_allocate();
}
BConearConstraint::~BConearConstraint()
{
	member_release();
}

void BConearConstraint::setTwistSpan(BReal twistSpan)
{
	member.twistSpan = twistSpan;
	this->emit(Signal_Changed);
}
BReal BConearConstraint::twistSpan() const
{
	return member.twistSpan;
}

void BConearConstraint::setSwingSpan1(BReal swingSpan1)
{
	member.swingSpan1 = swingSpan1;
	this->emit(Signal_Changed);
}
BReal BConearConstraint::swingSpan1() const
{
	return member.swingSpan1;
}

void BConearConstraint::setSwingSpan2(BReal swingeSpan2)
{
	member.swingSpan2 = swingeSpan2;
	this->emit(Signal_Changed);
}
BReal BConearConstraint::swingSpan2() const
{
	return member.swingSpan2;
}

void BConearConstraint::setSoftness(BReal softness)
{
	member.softness = softness;
	this->emit(Signal_Changed);
}
BReal BConearConstraint::softness() const
{
	return member.softness;
}

void BConearConstraint::setBiasFactor(BReal biasFactor)
{
	member.biasFactor = biasFactor;
	this->emit(Signal_Changed);
}
BReal BConearConstraint::biasFactor() const
{
	return member.biasFactor;
}

void BConearConstraint::setRelaxFactor(BReal relaxFactor)
{
	member.relaxFactor = relaxFactor;
	this->emit(Signal_Changed);
}
BReal BConearConstraint::relaxFactor() const
{
	return member.relaxFactor;
}

void BConearConstraint::setDamping(BReal damping)
{
	member.damping = damping;
	this->emit(Signal_Changed);
}
BReal BConearConstraint::damping() const
{
	return member.damping;
}

void BConearConstraint::setFixThresh(BReal fixThresh)
{
	member.fixThresh = fixThresh;
	this->emit(Signal_Changed);
}
BReal BConearConstraint::fixThresh() const
{
	return member.fixThresh;
}

void BConearConstraint::setSwingAxis(const BVector& swingAxis)
{
	member.swingAxis = swingAxis;
	this->emit(Signal_Changed);
}
BVector BConearConstraint::swingAxis() const
{
	return member.swingAxis;
}

void BConearConstraint::setTwistAxis(const BVector& twistAxis)
{
	member.twistAxis = twistAxis;
	this->emit(Signal_Changed);
}
BVector BConearConstraint::twistAxis() const
{
	return member.twistAxis;
}

void BConearConstraint::setKSwing(BReal kSwing)
{
	member.kSwing = kSwing;
	this->emit(Signal_Changed);
}
BReal BConearConstraint::kSwing() const
{
	return member.kSwing;
}

void BConearConstraint::setKTwist(BReal kTwist)
{
	member.kTwist = kTwist;
	this->emit(Signal_Changed);
}
BReal BConearConstraint::kTwist() const
{
	return member.kTwist;
}

void BConearConstraint::setTwistLimit(BReal twistLimit)
{
	member.twistLimit = twistLimit;
	this->emit(Signal_Changed);
}
BReal BConearConstraint::twistLimit() const
{
	return member.twistLimit;
}

void BConearConstraint::setSwingCorrection(BReal swingCorrection)
{
	member.swingCorrection = swingCorrection;
	this->emit(Signal_Changed);
}
BReal BConearConstraint::swingCorrection() const
{
	return member.swingCorrection;
}

void BConearConstraint::setTwistCorrection(BReal twistCorrection)
{
	member.twistCorrection = twistCorrection;
	this->emit(Signal_Changed);
}
BReal BConearConstraint::twistCorrection() const
{
	return member.twistCorrection;
}

void BConearConstraint::setAccSwingLimitImpulse(BReal accSwingLimitImpulse)
{
	member.accSwingLimitImpulse = accSwingLimitImpulse;
	this->emit(Signal_Changed);
}
BReal BConearConstraint::accSwingLimitImpulse() const
{
	return member.accSwingLimitImpulse;
}

void BConearConstraint::setAccTwistLimitImpulse(BReal accTwistLimitImpulse)
{
	member.accTwistLimitImpulse = accTwistLimitImpulse;
	this->emit(Signal_Changed);
}
BReal BConearConstraint::accTwistLimitImpulse() const
{
	return member.accTwistLimitImpulse;
}

BReal BConearConstraint::twistAngle() const
{
	return member.twistAngle;
}

void BConearConstraint::solve()
{

}
